package com.wnxy.sddfp.api.bank.fallback;

import com.wnxy.sddfp.api.bank.TradeLogApi;
import com.wnxy.sddfp.common.model.dto.bank.BankCardAddDTO;
import com.wnxy.sddfp.common.model.dto.bank.SignatureDto;
import com.wnxy.sddfp.common.model.vo.trade.BorrowSyncRecordVo;
import com.wnxy.sddfp.common.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 降级类，当远程调用出现异常时候执行
 */
@Component
@Slf4j
public class TradeLogApiFallback implements TradeLogApi {
    @Override
    public SignatureDto proxyBindCardLog(BankCardAddDTO bankCardAddDTO) {
        log.error("远程调用出现错误，请求参数：{}",bankCardAddDTO);
        SignatureDto signatureDto = new SignatureDto();
        signatureDto.setReqCode("远程调用出现错误,执行降级方法");
        return signatureDto;
    }

    @Override
    public Result sysncBorrowRecord(BorrowSyncRecordVo borrowSyncRecordVo) {
        return Result.fail();
    }
}
